/**
 * This file is part of AppStoreBot.
 *
 * AppStoreBot is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * AppStoreBot is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with AppStoreBot.  If not, see <http://www.gnu.org/licenses/>.
 *
 */
package lu.pragmaconsult.appstorebot;

import lu.pragmaconsult.appstorebot.itunes.ITunesConnectBot;

/**
 * 
 * A factory to produce a concrete {@link Bot} implementation.
 * 
 * @author Wilfried Vandenberghe (wilfried.vandenberghe at pragmaconsult.lu)
 */
public final class BotFactory {

	/**
	 * Default constructor. Is private to avoid a BotFactory object creation.
	 */
	private BotFactory() {

	}

	/**
	 * Factory method to build a Bot from a string array.
	 * 
	 * @param context
	 *            the bot context
	 * @return the produced bot
	 * @throws IllegalArgumentException
	 *             thrown when arguments cannot be parsed properly.
	 */
	public static final Bot createBot(BotContext context) {
		if(context.isHelp()) {
			return null;
		}
		
		return new ITunesConnectBot().configure(context);
	}

}
